package com.xtpt.disaster.utils;

import java.text.SimpleDateFormat;
import java.util.Date;

/*
时间处理工具类，用于生成数据库表创建时间和更新时间
 */
public class TimeUtil {
//    private static Date time = new Date();
    public static Date dateMaker(){
        return new Date();
    }

    public static String dateMakerString() {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss");
        return simpleDateFormat.format(dateMaker());
    }

    public static String dateMakerString(String fmt) {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(fmt);
        return simpleDateFormat.format(dateMaker());
    }

    public static String dateToString(Date date) {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss");
        return simpleDateFormat.format(date);
    }

}
